﻿import flash.display.BitmapData;
import kliment.display.MCC;
/**
 * ...
 * @author	Kliment
 * @version	0.1.0
 */
class kliment.effect.Flag {
	private var _target_mc:MovieClip;
	private var _output:BitmapData;
	
	public function Flag(target_mc:MovieClip, source) {
		
		if (source instanceof BitmapData) {
			_output = source.clone();
		} else if (source instanceof MovieClip){
			_output = new BitmapData(source._width, source._height, true, 0x000000);
			_output.draw(source);
		} else if (source.length > 0){
			var temp:MovieClip = MCC.create();
			temp._visible = false;
			MCC.attach(source, temp);
			_output = new BitmapData(temp._width, temp._height, true, 0x000000);
			_output.draw(temp);
			MCC.remove(temp);
		}
		MCC.attachBitmap(_target_mc, _output);
	}
	
}